package com.example.elasticsearchhepler.entity;

import com.example.elasticsearchhepler.annotations.ESField;
import com.example.elasticsearchhepler.enums.ESAnalyzerType;
import com.example.elasticsearchhepler.enums.ESFieldType;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
public class UserInfoEntity implements Serializable {

    private static final long serialVersionUID = 700143074187411912L;
    @ESField(name = "user_name",type = ESFieldType.Text,searchAnalyzer = ESAnalyzerType.IK_MAX_WORD,analyzer=ESAnalyzerType.IK_MAX_WORD)
    private String userName;

    @ESField(name = "province",type = ESFieldType.Integer)
    private String userAge;

    @ESField(name = "birth_date",type = ESFieldType.Date,format="yyyy-MM-dd'T'HH:mm:ss.SSS")
    private LocalDateTime birthDate;
}
